package com.example.forum.mapper;

import com.example.forum.entity.TTheme;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.forum.entity.TThemesByAreaIdModel;
import com.example.forum.vo.MyThemeReply;
import com.example.forum.vo.ThemeDto;
import com.example.forum.vo.ThemeReplyDto;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author why
 * @since 2020-04-22
 */
public interface TThemeMapper extends BaseMapper<TTheme> {
    /**
     * 查询主题和评论
     * @return
     */
    List<ThemeReplyDto> queryThemsAndReply(@Param("parm") Map parm);

    Long queryThemsAndReplyCount(@Param("parm") Map parm);

    Long queryThemOrReplyCount(@Param("parm") Map parm);

    /**
     * 查询主题或评论
     * @param parm
     * @return
     */
    List<ThemeReplyDto> queryThemOrReply(@Param("parm") Map parm);

    /**
     * 查询用户自己的主题和评论
     * @param parm
     * @return
     */
    List<MyThemeReply> queryMyThemeOrReply(@Param("parm") Map parm);

    Long queryMyThemeOrReplyCount(@Param("parm") Map parm);


    List<ThemeDto> homeThemeRecommend(HashMap<Object, Object> parms);

    Long homeThemeRecommendCount(HashMap<Object, Object> parms);

    //分页获取当前位置所有主题
    List<TThemesByAreaIdModel> getThemesByAreaId(@Param("pageIndex")Integer pageIndex,
                                                 @Param("pageSize")Integer pageSize,
                                                 @Param("blockId")String blockId,
                                                 @Param("areaId")String areaId);
//    List<TThemesByAreaIdModel> getThemesByAreaId(HashMap<Object, Object> parms);
    //获取当前位置所有主题数目
    Long getThemesByAreaIdCount(String blockId, String areaId);

    TTheme getThemesDetail(Map parms);

}
